import request from '@/utils/request'

// 查询生活习惯列表
export function listLifestyle(query) {
  return request({
    url: '/health/lifestyle/list',
    method: 'get',
    params: query
  })
}

// 查询生活习惯详细
export function getLifestyle(id) {
  return request({
    url: '/health/lifestyle/' + id,
    method: 'get'
  })
}

// 新增生活习惯
export function addLifestyle(data) {
  return request({
    url: '/health/lifestyle',
    method: 'post',
    data: data
  })
}

// 修改生活习惯
export function updateLifestyle(data) {
  return request({
    url: '/health/lifestyle',
    method: 'put',
    data: data
  })
}

// 删除生活习惯
export function delLifestyle(id) {
  return request({
    url: '/health/lifestyle/' + id,
    method: 'delete'
  })
}
